﻿using System.Data.Entity.ModelConfiguration;
using yiCommerce.Core.Domain.Products;
using yiCommerce.Core.Domain.Statuses;

namespace yiCommerce.Data.Mapping.Statuses
{
    public class StatusTagMapping : EntityTypeConfiguration<StatusTag>
    {
        public StatusTagMapping()
        {
            this.ToTable("Status_Tag_Mapping");
            this.HasKey(pp => pp.Id);

            this.HasRequired(pp => pp.Status)
                .WithMany(p => p.StatusTags)
                .HasForeignKey(pp => pp.StatusId);


            this.HasRequired(pp => pp.Tag)
                .WithMany(p => p.StatusTag)
                .HasForeignKey(pp => pp.TagId);
        }

    }
}